%module time

%{
#include <calendar.hpp>
#include <calendardefines.h>
#include <calendarrepository.h>
#include <daycounter.hpp>
#include <daycounterFactory.h>
#include <default_value.h>
#include <currencies/currency.hpp>
%}


%include <std_string.i>
%include <std_vector.i>
%include <boost_shared_ptr.i>

%shared_ptr(QuantLib::Calendar)

%template (DateVector) std::vector<QuantLib::Date>;
%template (CalendarVector) std::vector<boost::shared_ptr<QuantLib::Calendar> >;
%template (StringVector) std::vector<std::string>;

%rename (QLTime) Time;
/*%typemap(imtype) QuantLib::FinancialCenter "int"
%typemap(ctype) QuantLib::FinancialCenter "int";
%typemap(cstype) QuantLib::FinancialCenter "int";
%template (FinancialCenterVector) std::vector<QuantLib::FinancialCenter>;*/

#define TIME_RUNTIME_EXPORT
#define UTIL_RUNTIME_EXPORT
#define UTIL_EXPIMP_TEMPLATE

%typemap(cscode) QuantLib::Date %{
  public override string ToString()
  {
	string result = String.Format("{0,2:D2}/{1,2:d2}/{2,4:d4}", dayOfMonth(), (int)month(), year());
	return result;
  }
%}


%include <timeunit.hpp>
%include <frequency.hpp>
%include <period.hpp>
%include <weekday.hpp>
%include <timeunit.hpp>
%include <time.hpp>
%include <date.hpp>
%include <businessdayconvention.hpp>
%include <calendar.hpp>
%include <util/rounding.hpp>
%include <currencies/currency.hpp>



%ignore QuantLib::Utils::detail::ConfigurationRepository::get_child;
%ignore QuantLib::Utils::detail::ConfigurationRepository::getTree;
%ignore QuantLib::Utils::detail::ConfigurationRepository::append_default_value(boost::property_tree::ptree&);
%ignore QuantLib::Utils::detail::ConfigurationRepository::merge_default_value;
%ignore QuantLib::Utils::detail::ConfigurationRegistry;


%include <util/default_value.h>


/* Ignoring these temporarily as swig is having trouble generating std::vectror for FinancialCenter*/
%ignore QuantLib::BDate::get_base_calendars_list;
%ignore QuantLib::BDate::get_calendars_list;

%include <calendardefines.h>

/*%apply QuantLib::BDate::FinancialCenter {QuantLib::BDate::FinancialCenter const &};*/
%ignore QuantLib::BDate::Calendar::dump;
%ignore QuantLib::BDate::Calendar::initialize;
%ignore QuantLib::CalendarWrapper;
%include <calendar.h>
%include <daycounter.hpp>
%include <daycounterFactory.h>
%include <calendarrepository.h>
/*%include <imm.h>*/